using System;
using RMH.DataAccess;
using RMH.Entities;

namespace RMH.Services
{
    public interface IStaffService : IBaseService<Staff>
    {
        bool Validate(string username, string password);
        Staff GetByUserName(string name);
    }

    public class StaffService : BaseRepositoryBackedService<Staff, IStaffRepository>, IStaffService
    {
        private readonly IStaffRepository staffRepository;

        public StaffService(IStaffRepository repository) : base(repository)
        {
            staffRepository = repository;
            Console.Write("Made Staff Service.");
        }


        public bool Validate(string username, string password)
        {
            return true;
        }

        public Staff GetByUserName(string name)
        {            
            return staffRepository.GetByUserName(name);
        }
    }
}